#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cstdio>

using namespace std;

int main()
{
    double n1, n2, n3, n4, y, average, caverage;
    cin >> n1 >> n2 >> n3 >> n4;
    average = (n1 * 2 + n2 * 3 + n3 * 4 + n4 * 1) / 10.0;
    if (average >= 7)
    {
        printf("Media: %.1lf\n", average);
        printf("Aluno aprovado.\n");
    }
    else if (average < 5)
    {
        printf("Media: %.1lf\n", average);
        printf("Aluno reprovado.\n");
    }
    else
    {
        printf("Media: %.1lf\n", average);
        printf("Aluno em exame.\n");
        cin >> y;
        printf("Nota do exame: %.1lf\n", y);
        caverage = (average + y) / 2.0;
        if (caverage >= 5)
            printf("Aluno aprovado.\n");
        else
            printf("Aluno reprovado.\n");
        printf("Media final: %.1lf", caverage);
    }
    return 0;
}

